package com.exercise.ThreadAttribute;

/**
 * 每个线程有一个唯一的标识符（`long` 类型），用于区分线程。
 */
public class ThreadIdExample {
    public static void main(String[] args) {
        Thread thread = new Thread(() -> {
            System.out.println("Thread ID:" + Thread.currentThread().getId());
            System.out.println("Thread ID:" + Thread.currentThread().threadId());
        });
        thread.start();
        System.out.println("Main Thread ID: " + Thread.currentThread().getId());
        System.out.println("Main Thread ID: " + Thread.currentThread().threadId());

    }
}
